Python Data Analytics by Fabio Nelli
Author:Fabio Nelli
Language: eng
Format: epub, pdf
ISBN: 9781484239131
Publisher: Apress
Saving Your Chart Directly as an Image
If you are interested in saving only the figure of a chart as an image file, ignoring all the code you’ve written during the session, this is also possible. In fact, thanks to the savefig() function, you can directly save the chart in a PNG format, although you should take care to add this function to the end of the same series of commands (otherwise you’ll get a blank PNG file).In [ ]: plt.axis([0,5,0,20])
...: plt.title('My first plot',fontsize=20,fontname='Times New Roman')
...: plt.xlabel('Counting',color='gray')
...: plt.ylabel('Square values',color='gray')
...: plt.text(1,1.5,'First')
...: plt.text(2,4.5,'Second')
...: plt.text(3,9.5,'Third')
...: plt.text(4,16.5,'Fourth')
...: plt.text(1.1,12,'$y = x^2$',fontsize=20,bbox={'facecolor':'yellow','alpha':0.2})
...: plt.grid(True)
...: plt.plot([1,2,3,4],[1,4,9,16],'ro')
...: plt.plot([1,2,3,4],[0.8,3.5,8,15],'g^')
...: plt.plot([1,2,3,4],[0.5,2.5,4,12],'b*')
...: plt.legend(['First series','Second series','Third series'],loc=2)
...: plt.savefig('my_chart.png')
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8293)
Test-Driven Development with Java by Alan Mellor(6679)
Data Augmentation with Python by Duc Haba(6582)
Principles of Data Fabric by Sonia Mezzetta(6345)
Learn Blender Simulations the Right Way by Stephen Pearson(6236)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6102)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5501)
Big Data Analysis with Python by Ivan Marin(5338)
The Infinite Retina by Robert Scoble Irena Cronin(5199)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5142)
Pretrain Vision and Large Language Models in Python by Emily Webber(4299)
Infrastructure as Code for Beginners by Russ McKendrick(4061)
Functional Programming in JavaScript by Mantyla Dan(4037)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3774)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3577)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3553)
